package com.yf1706.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yf1706.bean.RecApplyRecord;
import com.yf1706.bean.RecTemplate;
import com.yf1706.dao.jpa.IRecTemplateJDAO;
import com.yf1706.dao.mybatis.IRecTemplateMDAO;

@Service
@Transactional(rollbackFor=Exception.class)
public class RecTemplateService {
	@Autowired
	private IRecTemplateMDAO rtmdao;
	@Autowired
	private IRecTemplateJDAO rtjdao;

	
	//一、查询所有
	public List<RecTemplate> queryAllRecTemplate(){
		return rtmdao.queryAllRecTemplate();
	}
	
	//二、模糊查询
	public List<RecTemplate> getSearchRecTemplate(String searchValue){
		return rtmdao.querySearchRecTemplate(searchValue);
	}
	
	//三、新增
	public void addRecTemplate(RecTemplate rt){
		rtjdao.save(rt);
	}
	
	//四、修改
	public void updateRecTemplate(RecTemplate rt){
		rtjdao.save(rt);
	}
	
	//五、删除方法
	public void deleteRecTemplate(int id) {
		rtjdao.deleteById(id);
	}
	
	
}
